package org.ehe.erp.mapper.product;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.ehe.common.mybatis.core.mapper.BaseMapperPlus;
import org.ehe.erp.domain.product.ErpProductArrival;
import org.ehe.erp.domain.product.vo.ErpProductArrivalVo;

import java.util.List;

/**
 * @author :zhangnn
 * @className :ErpProductArrivalMapper
 * @description: TODO
 * @date 2025-08-19 09:15:41
 */
public interface ErpProductArrivalMapper extends BaseMapperPlus<ErpProductArrival, ErpProductArrivalVo> {

    /**
     * 统计指定BOM下未到货的订单数量
     * @param purchaseOrders
     * @return 未到货的批次数量
     */
    int countUnArrivedByPurchaseOrders(@Param("purchaseOrders") List<String> purchaseOrders);

    /**
     * 查询指定BOM下主订单信息
     * @param bomId BOM ID
     * @return 批次ID列表
     */

    List<String> selectPurchaseOrdersByBomId(@Param("bomId") Long bomId,@Param("parentId") Long parentId);

    /**
     * 根据到货记录ID查询BOM ID
     * @param arrivalId 到货记录ID
     * @return BOM ID
     */
    String selectOrderNoById(@Param("arrivalId") Long arrivalId);

    Long getBomInfoByOrderNo(@Param("orderNo")  String orderNo);
}
